﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SetVersionNumber.VersionStrategies;

namespace SetVersionNumberTests.VersionStrategies {

	/// <summary>
	/// All of the unit tests for the <c>DateAndBuildVersionStrategy</c> class.
	/// </summary>
	[TestClass]
	public class DateAndBuildVersionStrategyTests {

		[TestMethod]
		public void ReturnedVersionStringIsDatePlusIncrementedRevision( ) {
			// Setup our test
			var now = DateTime.Now;
			const string input = "1.2.3.42";
			const string expectedTemplate = "{0}.{1}.{2}.43";
			string expected = string.Format(expectedTemplate, now.Year, now.Month, now.Day);

			// Run the test
			var sut = new DateAndBuildVersionStrategy();
			var actual = sut.GetNextVersionNumber(input);
			Assert.AreEqual(expected, actual, "The version number returned from the DateAndBuildVersionStrategy strategy is not correct");
		}

	}//class

}//namespace
